<%-- 
    Document   : index
    Created on : 18/06/2011, 11:21:20
    Author     : flavioam
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://static.jquery.com/ui/css/base.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/ui-lightness/jquery-ui.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />


<script>
    
    $(function() {
        $( "#dialog" ).dialog({
            autoOpen: true,
            bgiframe: true,
            modal: true,
            width: "400px",
            zIndex:0,
            buttons: {
                Login: function() {
                    
                    var nomeUsuario = $("#nomeUsuario").val();
                    var senha = $("#senha").val();
						
                    $.post("aut", { nomeUsuario: nomeUsuario, senha: senha},													   
                    function(data){
                                                //if the record was updated
                        if (data.status == 'ok'){										

                            location.replace("principal.jsp");																						
                        }
                        else{
                            alert("Usuario e/ou senha incorretos!");
                        }
                    }, "json");
                }					
            }				
        });			
    });

    
</script>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Locadora OnLine</title>
    </head>
    <body>

        <h1 style="padding-top: 30px;padding-left: 40px;color: white;">Locadora On line</h1>

    </body>
    <div id="dialog" title="Login">

        <table>
            <tr>
                <td>Nome de Usuário:</td>
                <td><input type="text" id="nomeUsuario" name="nomeUsuario"></input></td>
            </tr>
            <tr>
                <td>Senha:</td>
                <td><input type="password" id="senha" name="senha"></input></td>
            </tr>
        </table>      
    </div>
</html>


